home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
10,000 Great Games
/
10,000 Great Games.iso
/
Product
/
66
/
data1.cab
/
Source_Files
/
Src
/
QuickStart.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2000-01-16
|
2KB
|
83 lines
#include "stdafx.h"
#include "PlayerSelect.h"
#include "QuickStart.h"
int started_with_quickstart = FALSE;
char quickstart_level[_MAX_FNAME] = "demo";
CQuickStart::CQuickStart(CWnd* pParent)
: CDialog(CQuickStart::IDD, pParent)
{
//{{AFX_DATA_INIT(CQuickStart)
//}}AFX_DATA_INIT
}
void CQuickStart::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CQuickStart)
DDX_Control(pDX, IDC_QS_LEVEL, m_Level);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CQuickStart, CDialog)
//{{AFX_MSG_MAP(CQuickStart)
ON_BN_CLICKED(ID_QS_SELECT, OnSelect)
ON_BN_CLICKED(ID_QS_EXIT, OnExit)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CQuickStart::OnSelect()
{
CPlayerSelect p;
p.DoModal();
}
void CQuickStart::OnOK()
{
started_with_quickstart = TRUE;
mainwindow->PostMessage(WM_COMMAND, ID_RUN_LEVEL, 0);
CDialog::OnOK();
}
void CQuickStart::OnExit()
{
mainwindow->PostMessage(WM_CLOSE, 0, 0);
}
BOOL CQuickStart::OnInitDialog()
{
CDialog::OnInitDialog();
// Add levels to combobox
CFileFind files;
BOOL ok = files.FindFile("*.bdl");
while (ok)
{
ok = files.FindNextFile();
m_Level.AddString(files.GetFileTitle());
}
// Select one
m_Level.SelectString(0, quickstart_level);
if (m_Level.GetCurSel() == -1)
m_Level.SetCurSel(0);
return TRUE;
}
void CQuickStart::OnDestroy()
{
CDialog::OnDestroy();
m_Level.GetLBText(m_Level.GetCurSel(), quickstart_level);
}